import request from '../request'

const Api = {
    page: '/api/sys/oss/page',
    upload: '/api/sys/oss/upload',
}

/** 文件列表 */
export const page = data => {
    return request.request({
        url: Api.page,
        params: data,
        method: 'get'
    })
}

/** 文件上传 */
export const uploadFiles = async data => {
    const _file = data.file;
    // const isOverride = this.checked == true ? 1 : 0
    const formData = new FormData();
  formData.append('file', _file);
  console.log(formData, _file, data,"formData")
    // formData.append('isOverride', isOverride); // isOverride自定义的其他参数
    const res = await request.request({
      url: Api.upload,
      params: formData,
      method: 'POST',
    });

    // console.log(11111,res)

    return res
}
